package io.xxx.xbutler.client;

import io.xxx.xbutler.domain.Store;
import io.xxx.xbutler.domain.StoreOrder;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.data.util.Pair;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.time.LocalDate;
import java.util.List;

@FeignClient(value = "x-store", fallback = StoreClientFallback.class)
public interface StoreClient {

    @GetMapping("/store/get")
    Store getStore(@RequestParam Long id);

    @GetMapping("/store/list/by_label")
    Pair<List<Long>, Long> getStoreIds(@RequestParam Long labelItemId, @RequestParam Long nextId);

    /**
     * 查询门店会员日
     */
    @GetMapping("/store/is-prime-day")
    LocalDate getPrimeDay(@RequestParam Long storeId);

    /**
     * 查询门店的订单
     */
    @GetMapping("/store/order/get")
    StoreOrder getStoreOrder(@RequestParam Long storeId, @RequestParam LocalDate date);

    @GetMapping("/store/label/match")
    boolean match(@RequestParam Long storeId, @RequestParam Long labelItemId);
}
